package ru.evga.inse.server.gwt.user.client;

import ru.evga.inse.server.gwt.common.client.AbstractAppFactory;
import ru.evga.inse.server.gwt.user.client.menu.ContentActivityMapper;
import ru.evga.inse.server.gwt.user.client.menu.MainMenuView;
import ru.evga.inse.server.gwt.user.client.menu.MenuActivityMapper;
import ru.evga.inse.server.gwt.user.client.menu.MenuFactory;
import ru.evga.inse.server.gwt.user.client.menu.SubMenuActivityMapper;

import com.google.gwt.user.client.ui.Widget;


public class UserAppFactoryImpl
    extends AbstractAppFactory
    implements IUserAppFactory
{
    private final Shell m_shell = new Shell();
    private final MainMenuView m_menuView = new MainMenuView();
    private final MenuActivityMapper m_menuActivityMapper;
    private final SubMenuActivityMapper m_subMenuActivityMapper;
    private final ContentActivityMapper m_contentActivityMapper;
    private MenuFactory m_menuFactory = new MenuFactory();

    public UserAppFactoryImpl()
    {
        m_menuActivityMapper = new MenuActivityMapper(this);
        m_subMenuActivityMapper = new SubMenuActivityMapper(this);
        m_contentActivityMapper = new ContentActivityMapper(this);
    }

    public Shell getShell()
    {
        return m_shell;
    }

    public MainMenuView getMainMenuView()
    {
        return m_menuView;
    }

    public MenuActivityMapper getMainMenuActivityMapper()
    {
        return m_menuActivityMapper;
    }

    public ContentActivityMapper getContentActivityMapper()
    {
        return m_contentActivityMapper;
    }

    public SubMenuActivityMapper getSubMenuActivityMapper()
    {
        return m_subMenuActivityMapper;
    }

    public MenuFactory getMenuFactory()
    {
        return m_menuFactory;
    }

    public Widget getShellWidget()
    {
        return m_shell.asWidget();
    }
}
